<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="blocks/quickmail/db" VERSION="20091015" COMMENT="XMLDB file for block blocks/quickmail"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
  <TABLES>
    <TABLE NAME="block_quickmail_log" COMMENT="Stores the email history for the quickmail block" NEXT="block_quickmail_signatures">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"  NEXT="courseid"/>
        <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="userid"/>
        <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="courseid" NEXT="alternateid"/>
        <FIELD NAME="alternateid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false" PREVIOUS="userid" NEXT="mailto"/>
        <FIELD NAME="mailto" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="alternateid" NEXT="subject"/>
        <FIELD NAME="subject" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="mailto" NEXT="message"/>
        <FIELD NAME="message" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="subject" NEXT="attachment"/>
        <FIELD NAME="attachment" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" PREVIOUS="message" NEXT="format"/>
        <FIELD NAME="format" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="attachment" NEXT="time"/>
        <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="format"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for block_quickmail_log" NEXT="courseid"/>
        <KEY NAME="courseid" TYPE="foreign" FIELDS="courseid" REFTABLE="course" REFFIELDS="id" PREVIOUS="primary" NEXT="userid"/>
        <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="courseid"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="block_quickmail_signatures" COMMENT="Stores signatures for users" PREVIOUS="block_quickmail_log" NEXT="block_quickmail_drafts">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"  NEXT="userid"/>
        <FIELD NAME="userid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"  PREVIOUS="id" NEXT="title"/>
        <FIELD NAME="title" TYPE="char" LENGTH="125" NOTNULL="false" SEQUENCE="false"  PREVIOUS="userid" NEXT="signature"/>
        <FIELD NAME="signature" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false"  PREVIOUS="title" NEXT="default_flag"/>
        <FIELD NAME="default_flag" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false"  PREVIOUS="signature"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="block_quickmail_drafts" COMMENT="Stores drafts for users" PREVIOUS="block_quickmail_signatures" NEXT="block_quickmail_config">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"  NEXT="courseid"/>
        <FIELD NAME="courseid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"  PREVIOUS="id" NEXT="userid"/>
        <FIELD NAME="userid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"  PREVIOUS="courseid" NEXT="alternateid"/>
        <FIELD NAME="alternateid" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false"  PREVIOUS="userid" NEXT="mailto"/>
        <FIELD NAME="mailto" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false"  PREVIOUS="alternateid" NEXT="subject"/>
        <FIELD NAME="subject" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false"  PREVIOUS="mailto" NEXT="message"/>
        <FIELD NAME="message" TYPE="text" LENGTH="medium" NOTNULL="false" SEQUENCE="false"  PREVIOUS="subject" NEXT="attachment"/>
        <FIELD NAME="attachment" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false"  PREVIOUS="message" NEXT="format"/>
        <FIELD NAME="format" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false"  PREVIOUS="attachment" NEXT="time"/>
        <FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="false" UNSIGNED="true" SEQUENCE="false"  PREVIOUS="format"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="block_quickmail_config" COMMENT="Stores config info for teachers, per instance basis." PREVIOUS="block_quickmail_drafts" NEXT="block_quickmail_alternate">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"  NEXT="coursesid"/>
        <FIELD NAME="coursesid" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="true" SEQUENCE="false"  PREVIOUS="id" NEXT="name"/>
        <FIELD NAME="name" TYPE="char" LENGTH="25" NOTNULL="true" SEQUENCE="false"  PREVIOUS="coursesid" NEXT="value"/>
        <FIELD NAME="value" TYPE="char" LENGTH="125" NOTNULL="false" SEQUENCE="false"  PREVIOUS="name"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="block_quickmail_alternate" COMMENT="Stores alternate email sources for users." PREVIOUS="block_quickmail_config">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true"  NEXT="courseid"/>
        <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="false"  PREVIOUS="id" NEXT="address"/>
        <FIELD NAME="address" TYPE="char" LENGTH="100" NOTNULL="true" SEQUENCE="false"  PREVIOUS="courseid" NEXT="valid"/>
        <FIELD NAME="valid" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false"  PREVIOUS="address"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
      </KEYS>
    </TABLE>
  </TABLES>
</XMLDB>

